﻿

Public Class PanelComment

    'Fields :
    Private _LocalComment As New Comment
    Private _TargetNode As ZipNode
    Public WriteOnly Property TargetNode As ZipNode
        Set(value As ZipNode)
            _TargetNode = value
            _LocalComment.CopyFrom(_TargetNode.ZipSettings.Comment)
            ShowComment()
        End Set
    End Property
    'Show Comment :
    Private Sub ShowComment()
        KTB_Comment.Text = _LocalComment.Text
        KCB_EmbedZipInfos.Checked = _LocalComment.EmbedZipInfos
    End Sub
    'Actions :
    Public Sub Reset()
        _LocalComment.Reset()
        ShowComment()
    End Sub
    Public Sub Cancel()
        _LocalComment.CopyFrom(_TargetNode.ZipSettings.Comment)
        ShowComment()
    End Sub
    Public Sub Apply()
        _TargetNode.ZipSettings.Comment.Text = KTB_Comment.Text
        _TargetNode.ZipSettings.Comment.EmbedZipInfos = KCB_EmbedZipInfos.Checked
        Me.TargetNode = _TargetNode
    End Sub

End Class
